home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
JCSM Shareware Collection 1993 November
/
JCSM Shareware Collection - 1993-11.iso
/
cl720
/
qbscr2j.lzh
/
DISENTRY.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-07-08
|
4KB
|
80 lines
SUB DisplayEntry (entry$, qfg%, qbg%, hfg%, hBG%, fg%, bg%, marker$, divider$, wid%, actionCode%)
'┌─────────────────────────────────────────────────────────────────────────┐
'│ This routine is used only by the MakeMenu% Function. It is not meant │
'│ for use on its own. The routine displays the passed menu entry on the │
'│ screen, and highlights the character that proceeds the marker │
'│ character. Also interprets and displays menu dividers. │
'│ │
'│ Parameters are as follows: │
'│ │
'│ entry$ - the actual text entry to display on the screen │
'│ qfg% - Foreground color for 'Quick Access' key character │
'│ qbg% - Background color for 'Quick Access' key character │
'│ hfg% - Foreground color for entry at highlight bar │
'│ hbg% - Background color for entry at highlight bar │
'│ fg% - Foreground color for normal entry │
'│ bg% - Background color for normal entry │
'│ marker$ - the character used in menu entry strings that indicates │
'│ the next character is a 'Quick Access' key. │
'│ divider$ - The string or character that denotes a menu divider. │
'│ wid% - The full width of the menu window. │
'│ actionCode% - Has value of 1 or 2. 1 indicates that the entry │
'│ being displayed is a normal, unhighlighted entry, │
'│ thus the 'Quick Access' character in the entry will │
'│ be highlighted. If 2, 'Quick Access' key is not │
'│ highlighted, since entry is in highlight bar. │
'└─────────────────────────────────────────────────────────────────────────┘
'──────────────────────────────────────────────────────────────────────────
' Assumes cursor is already at the right spot to display entry on.
' Display each character until the marker char is found. Print highlighted
' 'Quick Access' char if ActionCode% is 1, otherwise print normal 'Quick
' Access' char. Then print rest of entry and return to MakeMenu%.
'──────────────────────────────────────────────────────────────────────────
'──────────────────────────────────────────────────────────────────────────
' Set colors.
'──────────────────────────────────────────────────────────────────────────
SELECT CASE actionCode%
CASE 1
COLOR fg%, bg%
CASE 2
COLOR hfg%, hBG%
CASE ELSE
END SELECT
'──────────────────────────────────────────────────────────────────────────
' If the entry is a menu divider, draw it. Otherwise, display text.
'──────────────────────────────────────────────────────────────────────────
IF entry$ = divider$ THEN
LOCATE CSRLIN, POS(0) - 1, 0
PRINT STRING$(wid% + 2, 196);
ELSE
FOR x% = 1 TO LEN(entry$)
IF MID$(entry$, x%, 1) = marker$ THEN
x% = x% + 1
SELECT CASE actionCode%
CASE 1
COLOR qfg%, qbg%
CASE 2
COLOR hfg%, hBG%
CASE ELSE
END SELECT
END IF
PRINT MID$(entry$, x%, 1);
IF actionCode% = 2 THEN
COLOR hfg%, hBG%
ELSE
COLOR fg%, bg%
END IF
NEXT x%
END IF
END SUB